package itcz.example.pattern.behavior_type.command.jdk_demo;

/**
 * @ClassName: TurnOffThread
 * @Author: ITCZ
 * @Date: 2025-07-24
 * @Description: 命令模式-具体命令角色，Runnable 是抽象命令角色
 */
public class TurnOffThread implements Runnable {
    // 引用接收者
    private Receiver receiver;

    public TurnOffThread(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void run() {
        // 接收者执行具体逻辑
        this.receiver.turnOff();
    }
}
